home *** CD-ROM | disk | FTP | other *** search
/ Family Forum 261 / SOMC Family Forum 261.iso / Xtras / Behavior Library.cst / 00048_Script_UI Rollover Change Member < prev    next >
Text File  |  1997-11-17  |  2KB  |  53 lines

  1. -- Rollover Change Member
  2.  
  3.  
  4. -- behavior library version 1.1
  5. -- a control
  6.  
  7. -- Display an alternate Image when mouse Pointer is over the sprite.
  8.  
  9. property  standardImage, alternateImage, nextCM
  10.  
  11. on mouseEnter me
  12.   set the member of sprite the spritenum of me = the alternateImage of me
  13. end  
  14.  
  15. on mouseLeave me
  16.   set the member of sprite the spritenum of me = the standardImage of me
  17. end
  18.  
  19. ---
  20.  
  21. on beginSprite me
  22.   set the standardImage of me = the member of sprite the spriteNum of me
  23.   
  24.   if nextCM = 1 then 
  25.     set memref = the member of sprite the currentspritenum
  26.     set castlibnum = the castlibnum of memref
  27.     set memdefault = member (the membernum of member memref + 1) of castlib castlibnum
  28.     set alternateImage = memdefault
  29.   end if
  30.   
  31. end
  32.  
  33. on getPropertyDescriptionList
  34.   
  35.   
  36.   if the currentspritenum = 0 then 
  37.     set memdefault = 0 
  38.   else
  39.     set memref = the member of sprite the currentspritenum
  40.     set castlibnum = the castlibnum of memref
  41.     set memdefault = member (the membernum of member memref + 1) of castlib castlibnum
  42.   end if
  43.   
  44.   
  45.   set p_list = [      #nextCM: [ #comment:   "Use Next Member:",                     #format:   #boolean,                    #default:    1 ],   #alternateImage: [ #comment:   "Rollover Cast Member:",                     #format:   #graphic,                    #default:    memdefault ]                  ]
  46.   return p_list
  47. end
  48.  
  49. on getBehaviorDescription
  50.   return "Change the sprite's cast member when the mouse rolls over the current sprite." & RETURN & "PARAMETERS:" & RETURN & "ò Use Next Member - Turn this option on to automatically display the next cast member in the cast when mouse rolls over the sprite."& RETURN & "ò Rollover Cast Member - Choose a specific cast member to appear when the mouse rolls over the sprite. This setting is ignored if Use Next Member is on."
  51. end
  52.  
  53.